<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<div id="testAAA">testAAA</div>
<script crossorigin>
  window.onerror = function(errorMessage, scriptURI, lineNumber,columnNumber,errorObj) {
    console.log("错误信息：" , errorMessage);
    console.log("出错文件：" , scriptURI);
    console.log("出错行号：" , lineNumber);
    console.log("出错列号：" , columnNumber);
    console.log("错误详情：" , errorObj);
  }
  let elementById = document.getElementById("testAAA")
  elementById.onclick=()=> {
    throw  new Error("aaaa")
  }
</script>
</body>
</html>
